It is a boring task to generate XML content with libraries like JDOM and DOM4J. You have to take each object and create then a new XML child. This task can be automated by a secondary XML-file that describes the way how the Java Object should be transformed or by meta annotations, a new feature of the J2SE 5. I worked some time with .NET and I love this meta annotations in source code. The technique is easy: Going through each part of the Java Object, looking for meta annotations, create an Xml Attribute, Xml Element or Xml Comment and then to put all them together in an XML document. Because JDOM is easy to use and a very elegant solutions, I uses this library. If I have enough time, I would like to implement the W3C XML Encryption standards, but that takes a long long time ;-)